use ".... iowa retention.dta"

label var CTYPOP "County Population (Census Bur.)"
label var CTYREG "Registered voters in county"
label var BAKERY "Baker 'Yes' Votes, 2010"
label var BAKERN "Baker 'No' votes, 2010"
label var BAKERT "Baker total votes cast, 2010"
label var BAKERR "Baker % Retain, 2010"
label var STREITY "Streit 'Yes' Votes, 2010"
label var STREITN "Streit 'No' votes, 2010"
label var STREITR "Streit % Retain, 2010"
label var STREITT "Streit total votes cast, 2010"
label var TERNUSY "Ternus 'Yes' Votes, 2010"
label var TERNUSN "Ternus 'No' votes, 2010"
label var TERNUST "Ternus total votes cast, 2010"
label var TERNUSR "Ternus % retain, 2010"
label var ALLJUSR "Avg % retain--all justices, 2010"
label var REPAD "# Registered Republicans"
label var REPAD_A "Reg Republicans as % of reg voters"
label var DEMAD "# Registered Democrats"
label var DEMAD_A "Reg. Democrats as % of reg. voters"
label var EVANAD "# of Evangelical adherents (Assoc. Religion Data Archives)"
label var EVANAD_A "Evangelical adherents as % of reg. voters"
label var CATHAD "# of Catholic adherents (Assoc. Religion Data Archives)"
label var CATHAD_A "Catholic adherents as % of reg. voters"
label var var46 "Median age in county(Census Bureau)"
label var EDATMT "% in county holding bachelor's degree or higher (Census Bureau)"
label var EDATMT_A  "% in county holding bachelor's degree or higher (Census Bureau)"
label var GUBERT "# votes cast for gubernatorial election, 2010"
label var AVEJUS "avg. # votes cast in Sup. Ct. race, 2010"
label var ROLLOFF "% roll-off, 2010"
label var MEDIAM "Media market defined by CMAG"
label var ADAIRS "# of ad airings in media market, 2010"
label var STREITY_A "Sreit Yes votes, 2002"
label var STREITN_A "Streit No votes, 2002"
label var STREITT_A "Streit Total votes, 2002"
label var STREITR_A "Streit % Retain, 2002"
label var TERNUSY_A "Ternus Yes votes, 2002"
label var TERNUSN_A "Ternus No votes, 2002"
label var TERNUST_A "Ternus Total votes, 2002"
label var TERNUSR_A "Ternus % Retain, 2002"
label var GUBERT_A "# votes cast in gubernatorial election, 2002"
label var AVEJUS_A "avg. # votes cast in Sup. Ct. race, 2002"
label var ROLLOFF_A "% roll-off, 2002"
label var diffrolloff "Difference in roll-off, 2002-2010"
label var bakerroll10 "Baker % roll-off, 2010"
label var streitroll10 "Streit % roll-off, 2010"
label var ternusroll10 "Ternus % roll-off, 2010"
label var ternusroll02 "Ternus % roll-off, 2002"
label var streitroll02 "Streit % roll-off, 2002"
label var diffternusroll10to02 "Difference in Ternus roll-off, 2010-2002"
label var diffstreitroll10to02 "Difference in Streit roll-off, 2010-2002"
label var diffrolloff02to10 "Difference in Rolloff, 2002-2010"
label var diffrolloff10to02 "Difference in rolloff, 2010-2002"
rename var46 medage


*Table 2, Avg. County-level roll-off, 2010
reg    ROLLOFF REPAD_A EVANAD_A  medage ADAIRS EDATMT_A, robust beta
*same model w/clustered s.e.
reg    ROLLOFF REPAD_A EVANAD_A  medage ADAIRS EDATMT_A, vce(cluster COUNTY)


*Table 3, Change in roll-off, 2002-2010
reg  diffrolloff10to02  REPAD_A EVANAD_A medage ADAIRS EDATMT_A, robust beta



*Table 4, Vote share, 2010

reg  ALLJUSR  REPAD_A EVANAD_A  medage ADAIRS EDATMT_A, robust beta

*same model w/ clustered s.e.
reg  ALLJUSR  REPAD_A EVANAD_A  medage ADAIRS EDATMT_A, vce(cluster COUNTY)

